package com.weixing.mall.provider.controller;


import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.core.support.auth.MemAuth;
import com.weixing.mall.core.support.auth.MemInfo;
import com.weixing.mall.provider.model.query.OrderPointQuery;
import com.weixing.mall.provider.service.IOrderPointService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "后端:积分商品订单",tags = "后端:积分商品订单")
@RestController
@RequestMapping("/admin/orderPoint")
public class OrderPointController extends BaseController {
    @Autowired
    private IOrderPointService orderPointService;
    /**
     * 积分商品订单列表
     */
    @ApiOperation(value = "积分商品订单列表")
    @PostMapping("list")
    public Result selectOrderPointList(@RequestBody OrderPointQuery orderPointQuery){
        return ResultUtil.success(orderPointService.selectOrderPointList(initMpPage(),orderPointQuery,null));
    }

    /**
     * 变更积分商品订单状态
     */
    @ApiOperation(value = "变更积分商品订单状态")
    @GetMapping(value = "updateStatus/{status}/{orderPointId}")
    public Result updateOrderPointStatus(@PathVariable(value = "status") Integer status,@PathVariable(value = "orderPointId") Long orderPointId){
        return orderPointService.updateOrderPointStatus(orderPointId,status);
    }
}
